<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<style>
			#box{
				width:300px;
				height:100px;
				font-size: 18px;
				text-align: center;
				border: 1px solid #ccc;
			}
		</style>
	</head>
	<body>
		<div id="box">这里是内容</div>
		<input  id="ipt" >
		<button id="btn">点击</button>
		
		<script>
			window.onload = function(){
				var oipt = document.getElementById("ipt");
				var obtn = document.getElementById("btn");
				var obox = document.getElementById("box");
				
				obtn.onclick = function(){
					var ov = oipt.value;
					obox.innerHTML = ov;
					obox.style.bavkgroundColor = ov;
				}
				
				
			}
			
		</script>
		
	</body>
</html>
